#include <QGuiApplication>
#include <QQmlContext>
#include <QQmlApplicationEngine>
#include "databasequeue.h"
#include "databaseengine.h"
#include "person.h"
#include "curriculum.h"

int main(int argc, char *argv[])
{
    QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);

    QGuiApplication app(argc, argv);

    emit DatabaseQueue::instance()->createDatabaseConnection();

    QQmlApplicationEngine engine;
    QQmlContext *context = engine.rootContext();
    DatabaseEngine* databse_engine = DatabaseEngine::Instance();
    context->setContextProperty("DatabaseEngine",databse_engine);
    qmlRegisterType<Person>("com.gocampus",1,0,"Person");
    qmlRegisterType<Curriculum>("com.gocampus",1,0,"Curriculum");
    qRegisterMetaType<Person>("Person");
    qRegisterMetaType<Curriculum>("Curriculum");
    engine.load(QUrl(QStringLiteral("qrc:/main.qml")));


    return app.exec();
}
